'''
Created on 2017年5月27日

@author: lingxiang
'''
#!/usr/bin/env python
import urllib.request
def get_oneip():
    
    page = urllib.request.urlopen("http://127.0.0.1:5000/get/")
    lines = page.readlines()
    page.close()
    ip = ""
    for line in lines :
        ip = ip + line.decode('utf-8')
    return ip
    

def get_allip():
    
    page = urllib.request.urlopen("http://127.0.0.1:5000/get_all/")
    lines = page.readlines()
    page.close()
    
    document = ""
    for line in lines :
        document = document + line.decode('utf-8')
    return document
        
def dele_ip(proxy):
    page = urllib.request.urlopen("http://127.0.0.1:5000/delete/%s"%proxy)
    lines = page.readlines()
    page.close()
    document = ""
    
    for line in lines :
        document = document + line.decode('utf-8')
       
    return document
    